<!-- 公告信息 -->
<template>
    <view>
        <status-bar title='公告信息' :goHome='fromShare'></status-bar>
        <view v-if="list.length">
            <view class="item padding30" v-for="(item,index) in list" :key="index" @click="toUrl('/privatePage/single/noticeDetail?id=' + item.website_article_id)">
                <view class="d-flex j-sb a-center m-bot20">
                    <view class="size34 color_22 bold">{{ item.website_article_title }}</view>
                    <view class="dot" v-if="item.is_read == 0"></view>
                </view>
                <view class="h6 color_66">{{ item.website_article_addtime }}</view>
            </view>
        </view>
        <view class="p-top180 text-center" v-else>
            <image :src="imgUrl + 'Uploads/private/no_ad.png'" mode="widthFix" style="width: 570rpx;"></image>
        </view>
    </view>
</template>

<script>
export default {
    data(){
        return {
            fromShare: 0,
            imgUrl: this.imgUrl,
            list: []
        }
    },
    onLoad(){
        this.getList()
    },
    methods: {
        getList(){
            this.$http.get({
                url: '/PrivateSphereApi/getResource',
                data: {
                    type: 'notice'
                }
            }).then(res=>{
                if(res.code != 200) return this.$Toast(res.msg)
                this.list = res.data || []
            })
        }
    }
}
</script>

<style lang="scss" scoped>
.item {
    border-bottom: 1rpx solid #D9D9D9;
    .dot {
        width: 20rpx;
        height: 20rpx;
        background: #FF5C5C;
        border-radius: 50%;
    }
}
</style>